package com.han.yweb;

import com.han.yweb.annotation.Starter;
import com.han.yweb.core.Server;
import com.han.yweb.core.YwebServer;

@Starter
public class YwebApplication {

    private final static String DEFAULT_CONTEXT_PATH = "/";

    public static void main(String[] args) throws ClassNotFoundException {
        Server server = new YwebServer();
        server.start(YwebApplication.class);
    }

//    public static void main(String[] args) throws Exception {
//        Tomcat tomcat = new Tomcat();
//
//        String classpath = System.getProperty("user.dir");
//
//        tomcat.getConnector().setPort(8081);
//        tomcat.addContext(DEFAULT_CONTEXT_PATH, classpath);
//
//        Wrapper wrapper = tomcat.addServlet(DEFAULT_CONTEXT_PATH, HelloServlet.class.getName(), new HelloServlet());
//        wrapper.addMapping("/hello");
//
//        tomcat.start();
//        tomcat.getServer().await();
//    }
}
